cmake_minimum_required(VERSION 3.0)


include_directories(src/main/cpp
src/main/cpp/usbdevice
)

add_definitions(-D__android=1 -D__DEBUG=1)

set(ALG_DEP)
macro(add_alg_libs ROOT_DIR1)
    foreach(one ${ARGN})
        message(STATUS "Add ${one}")
        add_library(${one}  SHARED IMPORTED)
        set_target_properties(${one} PROPERTIES IMPORTED_LOCATION  ${ROOT_DIR1}/${ANDROID_ABI}/lib${one}.so )
        #
        list(APPEND ALG_DEP ${one})
    endforeach(one)
endmacro()

find_library(log-lib log)
find_library(glv2-lib GLESv2)

add_alg_libs(${CMAKE_CURRENT_LIST_DIR}/libs
ImiCamera iminect)

#
set(ALL_TEST_LIB)

macro(ADD_TEST_LIB DIR)
    include_directories(${DIR})
    add_subdirectory(${DIR} test)
    list(APPEND ALL_TEST_LIB ${ARGN})
endmacro()


## 利用次语句添加你的c++测试代码目录,

ADD_TEST_LIB(src/main/cpp/demo demo)

#ADD_TEST_LIB(/home/jetkey/lingzheng/mysvn/IMIClipTools/Slam4Vivo mytest)

##
set(USE_JNI_DYTEST TRUE)
#ADD_TEST_LIB(/home/jetkey/lingzheng/mysvn/IMIClipTools/Fusion mytest)

#ADD_TEST_LIB(/home/jetkey/lingzheng/mysvn/IMIClipTools/ObjectDetection mytest)

add_library(testsuit_jni SHARED
 src/main/cpp/testsuit_jni.cpp
 src/main/cpp/testsuit_framework.cpp
 )

 target_link_libraries(testsuit_jni ${log-lib} ${glv2-lib} ${ALG_DEP} ${ALL_TEST_LIB})

